package com.zxmc.server.controller.user;

import com.zxmc.common.result.PageResult;
import com.zxmc.common.result.Result;
import com.zxmc.pojo.dto.PageNovelQueryDto;
import com.zxmc.server.service.RecommendationService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user/recommend")
@Slf4j
@Api(tags = "推荐相关接口")
public class RecommendationController {

    @Autowired
    private RecommendationService recommendationService;

    @GetMapping("/page")
    public Result<PageResult> recommend(PageNovelQueryDto pageNovelQueryDto) {
        log.info("recommend{}", pageNovelQueryDto);
        PageResult pageResult = recommendationService.recommendNovels(pageNovelQueryDto);
        return Result.success(pageResult);
    }
}
